﻿using BCEntity.Common.News.ContentCategory;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Common.News.ContentCategory
{/// <summary>
 /// 内容分类数据处理
 /// </summary>
    public interface IContentCategoryData
    {
        /// <summary>
        /// 检查内容分类是否存在
        /// </summary>
        /// <param name="categoryName">分类名称</param>
        /// <returns></returns>
        Task<bool> CheckContentCategoryExists(string categoryName);
        /// <summary>
        /// 检查内容分类是否存在
        /// </summary>
        /// <param name="contentCategoryId">内容分类Id</param>
        /// <returns></returns>
        Task<bool> CheckContentCategoryExists(int contentCategoryId);
        /// <summary>
        /// 检查内容分类是否存在子级分类
        /// </summary>
        /// <param name="contentCategoryId">内容分类Id</param>
        /// <returns></returns>
        Task<bool> CheckContentCategoryChildrenExists(int contentCategoryId);

        /// <summary>
        /// 添加内容分类信息
        /// </summary>
        /// <param name="entity">内容分类信息</param>
        /// <returns></returns>
        Task<ContentCategoryEntity> Add(ContentCategoryEntity entity);
        /// <summary>
        /// 获取内容分类信息（分页）
        /// </summary>
        /// <param name="categoryLevel">分类级别</param>
        /// <param name="categoryName">分类名称</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<ContentCategoryEntity>, int)> Query(int? categoryLevel, string categoryName, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        /// <summary>
        /// 获取内容分类信息
        /// </summary>
        /// <param name="ContentCategoryId">内容分类信息Id</param>
        /// <returns></returns>
        Task<ContentCategoryEntity> GetEntity(int ContentCategoryId);
        /// <summary>
        /// 获取分类列表
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<ContentCategoryEntity>> GetList();
        /// <summary>
        /// 获取下一级分类列表
        /// </summary>
        /// <param name="contentCategoryId">内容分类Id</param>
        /// <returns></returns>
        Task<IEnumerable<ContentCategoryEntity>> GetNextCategoryById(int contentCategoryId);
        /// <summary>
        /// 更新内容分类信息
        /// </summary>
        /// <param name="entity">内容分类信息</param>
        /// <returns></returns>
        Task<ContentCategoryEntity> Update(ContentCategoryEntity entity);
        /// <summary>
        /// 删除内容分类信息
        /// </summary>
        /// <param name="ContentCategoryId">内容分类信息Id</param>
        /// <returns></returns>
        Task<bool> Delete(int ContentCategoryId);
        /// <summary>
        /// 获取某级别分类列表
        /// </summary>
        /// <param name="categoryLevel">分类级别</param>
        /// <returns></returns>
        Task<IEnumerable<ContentCategoryEntity>> GetLevelCategoryList(int categoryLevel);
        /// <summary>
		/// 启用内容分类
		/// </summary>
		/// <param name="contentCategoryId">内容分类Id</param>
		Task<bool> Enabled(int contentCategoryId);
        /// <summary>
        /// 禁用内容分类
        /// </summary>
        /// <param name="contentCategoryId">内容分类Id</param>
        Task<bool> Disabled(int contentCategoryId);
    }
}
